package com.qf.studentmanager.servlet;

import com.qf.studentmanager.model.User;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(urlPatterns = "/AdminServlet")
public class AdminServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//        User user = (User) request.getSession().getAttribute("loginUser");
//        request.setAttribute("user",user );   //不需要set，因为可以再session中拿到。
        request.getRequestDispatcher("/WEB-INF/jsp/admin/admin.jsp").forward(request, response);
    }
}
